#include <stdio.h>
#include <time.h>
#include <windows.h>

struct Time {
    int hours;
    int minutes;
    int seconds;
};

int main() {
    while (1) {
        // 获取当前时间
        time_t currentTime = time(NULL);
        struct tm *timeInfo = localtime(&currentTime);

        // 提取小时、分钟和秒
        struct Time currentTimeStruct;
        currentTimeStruct.hours = timeInfo->tm_hour;
        currentTimeStruct.minutes = timeInfo->tm_min;
        currentTimeStruct.seconds = timeInfo->tm_sec;

        // 打印时间
        printf("%02d:%02d:%02d\n", currentTimeStruct.hours, currentTimeStruct.minutes, currentTimeStruct.seconds);

        // 暂停一秒钟
        Sleep(1000);
        system("cls");
    }

    return 0;
}